cmake_minimum_required(VERSION 3.5)

project (test_hmi  VERSION "1.0.0")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")

# read system env
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/3pp/lib
                 ${CMAKE_CURRENT_SOURCE_DIR}/../TelltaleCtrl/Model/Logic/
                 ${CMAKE_CURRENT_SOURCE_DIR}/../
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/3pp/include/
                    ${CMAKE_CURRENT_SOURCE_DIR}/mock/
                    ${CMAKE_CURRENT_SOURCE_DIR}/../TelltaleCtrl/Model/Logic/
                    ${CMAKE_CURRENT_SOURCE_DIR}/../
)


file(GLOB TEST_SOURCE_DIR    "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp")
file(GLOB TEST_MOCK_DIR      "${CMAKE_CURRENT_SOURCE_DIR}/mock/*.c")
file(GLOB TESTCASE_DIR      "${CMAKE_CURRENT_SOURCE_DIR}/testcases/*.cpp")

file(GLOB ITE_PROJRCT_SRC_DIR      
    "${CMAKE_CURRENT_SOURCE_DIR}/../TelltaleCtrl/Model/Logic/TurnLampModel.c"
    "${CMAKE_CURRENT_SOURCE_DIR}/../TelltaleCtrl/Model/Logic/AirbagModel.c"
    "${CMAKE_CURRENT_SOURCE_DIR}/../TelltaleCtrl/Model/Logic/EpsModel.c"
    "${CMAKE_CURRENT_SOURCE_DIR}/../TelltaleCtrl/Model/Logic/SafetyBeltModel.c")

add_executable(test_hmi 
    ${TEST_SOURCE_DIR} 
    ${TEST_MOCK_DIR} 
    ${TESTCASE_DIR} 
    ${ITE_PROJRCT_SRC_DIR}
)


target_link_libraries(test_hmi
       pthread
       gtest
       gmock
       log_static
)
